<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateKmsAlbumMain extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('kms_album_main', function (Blueprint $table) {
            $table->id();

            $table->bigInteger("ownerUid")->comment("相册属主uid rms.uid");
            $table->tinyInteger("type")->default(0)->comment("相册类型 0 - 个人相册 1 - 团队相册 2 - 门店相册");
            $table->unsignedInteger('resourceLastUpdateTime')->default(0)->comment('资源最后更新时间');

            $table->unsignedInteger('isDeleted')->default(0)->comment('是否删除 0 - 正常 1 - 已删除');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '运营app - 相册主表';
            $table->index(["ownerUid"], 'idx_ownerUid');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('kms_album_main');
    }
}
